package com.saber.bean;

import java.util.Date;

/**
 *
 * @author sihai
 *
 */
public class Risk {

	/**
	 *
	 */
	public static final String COMPONENT_CPU = "CPU使用率过高 ";

	/**
	 *
	 */
	public static final String COMPONENT_MEMORY = "内存使用率过高";

	/**
	 *
	 */
	public static final String COMPONENT_DISK = "磁盘空间不足";

	/**
	 *
	 */
	public static final String COMPONENT_PROCESS = "以ROOT权限运行进程";

	/**
	 *
	 */
	public static final String COMPONENT_CC = "CC攻击";

	/**
	 *
	 */
	public static final String COMPONENT_SYN_FLOOD = "SYN_FLOOD";

	/**
	 *
	 * */
	public static final String COMPONENT_HTTP_FLOOD = "HTTP_FLOOD";

	/**
	 *
	 */
	public static final String COMPONENT_TRAFFIC_TOP = "应用Top流量突变";

	/**
	 *
	 */
	public static final String COMPONENT_USER_TRAFFIC = "用户日常流量突增";

	/**
	 *
	 */
	public static final String COMPONENT_USER_CONNECT = "用户连接频率突增";

	/**
	 *
	 */
	public static final String COMPONENT_URL = "疑似爬虫活动";

	/**
	 *
	 */
	public static final String COMPONENT_ICMP_FLOOD = "ICMP_FLOOD";

	/**
	 *
	 */
	public static final String COMPONENT_UDP_FLOOD = "UDP_FLOOD";

	/**
	 *
	 */
	public static final String COMPONENT_RUN_PROCESS = "可疑系统调用";

	/**
	 *
	 */
	public static final String BRUTE_FORCE_ATTACK = "暴力破解";

	/**
	 *
	 */
	public static final String UNUSUAL_LOCATION_LOGIN = "异地登录";

	/**
	 *
	 */
	public static final String ACCOUNT_OPERATION_EXCEPTION = "帐号活动异常";

	/**
	 *
	 */
	public static final String COMPONENT_WEB_PROCESS_WRITE_REG = "Web进程操作注册表";

	/**
	 *
	 */
	public static final String COMPONENT_WEB_SHELL = "可疑文件活动";

	/**
	 *
	 */
	public static final String COMPONENT_WEB_SUSPICIOUS_LINK = "可疑连接";

	/**
	 *
	 */
	public static final String COMPONENT_WEB_SHELL_ATTACT = "高危命令调用";

	/**
	 *
	 */
	public static final String PORT_SCAN = "端口扫描";

	/**
	 * 肉鸡异常阀值
	 */
	public static final int  CHICKEN_THRESHOLD = 10;

	// 风险类型
	public static enum RiskType {

		/**
		 * 帐号风险
		 */
		ACCOUNT_RISK,

		/**
		 * 主机风险
		 */
		HOST_RISK,

		/**
		 * 网络风险
		 */
		NETWORK_RISK,

		/**
		 * 应用风险
		 */
		APP_RISK;
	}

	//
	public static enum RiskLevel {

		/**
		 * 高危
		 */
		HIGH,

		/**
		 * 低危
		 */
		LOW;
	}

	//
	public static enum SourceType {

		/**
		 *
		 */
		HOST,

		/**
		 *
		 */
		SERVICE,

		/**
		 *
		 */
		APP;
	}

	//
	public static enum Status {

		/**
		 *
		 */
		OPEN,

		/**
		 *
		 */
		FIXED,

		/**
		 *
		 */
		CLOSED;
	}

	//
	public static enum ExceptionType {

		/**
		 *
		 */
		CPU_OVERLOAD("CPU使用率过高"),

		/**
		 *
		 */
		MEMORY_OVERLOAD("内存使用率过高"),

		/**
		 *
		 */
		DISK_OVERLOAD("磁盘空间不足"),

		/**
		 *
		 */
		BRUTE_FORCE_ATTACK("暴力破解"),

		/**
		 *
		 */
		UNUSUAL_LOCATION_LOGIN("异地登录"),

		/**
		 *
		 */
		ACCOUNT_OPERATION_EXCEPTION("帐号活动异常"),

		/**
		 *
		 */
		CC_ATTACK("CC攻击"),

		/**
		 *
		 */
		DDOS_ATTACK("DDOS攻击"),

		/**
		 *
		 */
		WEB_PROCESS_SAVED_EXECUTABLE_FILE("Web进程保存可执行文件"),

		/**
		 *
		 */
		WEB_PROCESS_WRITE_REG("Web进程操作注册表"),

		/**
		 *
		 */
		WEB_PROCESS_START_CHILD_PROCESS("Web进程启动可疑子进程"),

		/**
		 *
		 */
		WEB_SUSPICIOUS_LINK("可疑连接"),

		/**
		 *
		 */
		PROCESS_RUN_IN_ROOT("以ROOT权限运行进程"),

		/**
		 *
		 */
		WEB_SHELL("WebShell"),

		/**
		 *
		 */
		HOST_INTRUSION("主机入侵"),

		/**
		 *
		 */
		OUT_LINK("主动外连"),

		/**
		 *
		 */
		OTHER_NETWORK_EXCEPTION("其他网络风险"),

		/**
		 *
		 */
		PORT_SCAN("端口扫描"),

		/**
		 *
		 */
		TRAFFIC_EXCEPTION("流量异常"),

		/**
		 *
		 */
		CHICKEN("肉鸡"),

		/**
		 *
		 */
		PROCESS_PORT_ACTIVITY_EXCEPTION("进程端口活动异常");

		/**
		 *
		 */
		private final String title;

		public String getTitle() {
			return title;
		}

		/**
		 *
		 * @param title
		 */
		private ExceptionType(String title) {
			this.title = title;
		}
	}

	/**
	 *
	 */
	private RiskType riskType;

	/**
	 *
	 */
	private RiskLevel level;

	/**
	 *
	 */
	private Long source;

	/**
	 *
	 */
	private SourceType sourceType;

	/**
	 *
	 */
	private String component;

	/**
	 *
	 */
	private String type;

	/**
	 *
	 */
	private String detail;

	/**
	 *
	 */
	private Status status;

	/**
	 *
	 */
	private Date timestamp;

	/**
	 *
	 */
	private Object sourceObject;

	/**
	 *
	 */
	private Long user;

	public RiskType getRiskType() {
		return riskType;
	}

	public void setRiskType(RiskType riskType) {
		this.riskType = riskType;
	}

	public RiskLevel getLevel() {
		return level;
	}

	public void setLevel(RiskLevel level) {
		this.level = level;
	}

	public Long getSource() {
		return source;
	}

	public void setSource(Long source) {
		this.source = source;
	}

	public SourceType getSourceType() {
		return sourceType;
	}

	public void setSourceType(SourceType sourceType) {
		this.sourceType = sourceType;
	}

	public String getComponent() {
		return component;
	}

	public void setComponent(String component) {
		this.component = component;
	}

	public String getDetail() {
		return detail;
	}

	public void setDetail(String detail) {
		this.detail = detail;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Status getStatus() {
		return status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

	public Date getTimestamp() {
		return timestamp;
	}

	public void setTimestamp(Date timestamp) {
		this.timestamp = timestamp;
	}

	public Object getSourceObject() {
		return sourceObject;
	}

	public void setSourceObject(Object sourceObject) {
		this.sourceObject = sourceObject;
	}

	public Long getUser() {
		return user;
	}

	public void setUser(Long user) {
		this.user = user;
	}
}